/* Mini synthesizer styling */

.synth {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 8px;
  position: relative;
}

.synth::before,
.synth::after {
  content: "";
  position: absolute;
  top: 95px;
  width: 18px;
  height: 2px;
  background: rgba(231, 231, 231, 0.28);
}

.synth::before {
  left: calc(33.333% - 9px);
}

.synth::after {
  right: calc(33.333% - 9px);
}

.synth-module {
  flex: 1 1 200px;
  position: relative;
  background: var(--panel);
  border: 1px solid rgba(231, 231, 231, 0.18);
  border-radius: 6px;
  padding: 12px 14px 14px;
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
}

.synth-module-header {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 16px;
}

.synth-module-body {
  display: grid;
  gap: 10px;
}

.synth-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.synth-row .synth-wave-button {
  width: 100%;
  justify-content: center;
}

.synth-button {
  appearance: none;
  border-radius: 4px;
  border: 1px solid rgba(231, 231, 231, 0.35);
  background: rgba(15, 17, 18, 0.9);
  color: var(--text);
  padding: 3px 9px;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}

.synth-button:hover {
  transform: translateY(-1px);
  border-color: var(--cyan);
}

.synth-wave-button--active {
  background: rgba(106, 169, 189, 0.18);
  border-color: var(--cyan);
  color: var(--cyan);
}

.synth-wave-icon {
  display: inline-block;
  width: 26px;
  height: 12px;
}

.synth-wave-icon svg {
  width: 100%;
  height: 100%;
}

.synth-wave-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.synth-wave-label {
  display: inline-block;
}

.synth-play-button {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.synth-play-button::before {
  content: "▶";
  font-size: 10px;
}

.synth-play-button[data-state="playing"]::before {
  content: "⏹";
}

.synth-knob {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.synth-knob-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.synth-knob-wrapper {
  position: relative;
  width: 40px;
  height: 40px;
}

.synth-knob-input {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08), transparent 60%),
              radial-gradient(circle at 70% 70%, rgba(0, 0, 0, 0.7), transparent 60%);
  border: 2px solid rgba(192, 107, 166, 0.8);
  position: relative;
  cursor: pointer;
}

.synth-knob-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1px;
  height: 1px;
  background: transparent;
}

.synth-knob-input::-moz-range-thumb {
  width: 1px;
  height: 1px;
  background: transparent;
  border: none;
}

.synth-knob-input::-webkit-slider-runnable-track,
.synth-knob-input::-moz-range-track {
  background: transparent;
}

.synth-knob-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  margin-top: -3px;
  pointer-events: none;
  transform-origin: center center;
  /* Default rotation is set via JS with --knob-angle */
  transform: rotate(calc(var(--knob-angle, 0deg))) translateY(-9px);
}

.synth-knob-indicator::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 4px var(--yellow);
}

.synth-knob-value {
  font-size: 12px;
  color: var(--cyan);
  min-width: 56px;
  text-align: center;
  display: inline-block;
}

.synth-knob--lfo {
  position: relative;
  grid-template-columns: auto auto;
  grid-template-areas:
    "label label"
    "knob knob"
    "value dot";
}

.synth-knob--lfo .synth-knob-label {
  grid-area: label;
}

.synth-knob--lfo .synth-knob-wrapper {
  grid-area: knob;
}

.synth-knob--lfo .synth-knob-value {
  grid-area: value;
  justify-self: end;
}

.synth-lfo-indicator {
  grid-area: dot;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4d4d;
  box-shadow: 0 0 5px rgba(255, 77, 77, 0.8);
  opacity: 0.85;
  transform: scale(0.8);
  transition: transform 80ms linear, box-shadow 80ms linear, opacity 80ms linear;
}

.synth-scope-canvas {
  width: 100%;
  height: 110px;
  display: block;
  background: #0d1012;
  border-radius: 4px;
  border: 1px solid rgba(106, 169, 189, 0.6);
}

.synth-mute-button {
  width: 100%;
  font-size: 13px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.synth-mute-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.synth-mute-button[data-muted="false"] {
  background: rgba(106, 169, 189, 0.18);
  border-color: var(--cyan);
  color: var(--cyan);
}

.synth-module--oscillator .synth-module-body {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.synth-module--filter .synth-module-body {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.synth-module--scope {
  flex: 1 1 200px;
}

.synth-module--output {
  flex: 0 0 auto;
}

.synth-module--output .synth-module-body {
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 620px) {
  .synth-module--oscillator .synth-module-body {
    grid-template-columns: 1fr;
  }

  .synth-module--filter .synth-module-body {
    grid-template-columns: 1fr;
  }
}

.synth-status-text {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.synth-note {
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  margin-top: -16px;
  margin-bottom: 24px;
}

@media (max-width: 820px) {
  .synth::before,
  .synth::after {
    display: none;
  }
}

@media (max-width: 799px) {
  .synth {
    display: none;
  }

  .synth-note {
    display: none;
  }
}


